package com.ltx.mysqlcanalestest.domain.es;

import lombok.ToString;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

@Document(indexName = "hotel_index")
@ToString
public class Hotel {

    @Id
    private String id;

    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String hotelName;

    @Field(type = FieldType.Keyword)
    private String hotelBrand;

    @Field(type = FieldType.Double)
    private double rating;

    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String address;

    @Field(type = FieldType.Long)
    private String geoLocation;  // 存储经纬度信息，格式为 "lat,lon"

    // 酒店简介信息
    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String description;


    // 构造函数
    public Hotel() {
    }

    public Hotel(String id, String hotelName, String hotelBrand, double rating, String address, String geoLocation, String description) {
        this.id = id;
        this.hotelName = hotelName;
        this.hotelBrand = hotelBrand;
        this.rating = rating;
        this.address = address;
        this.geoLocation = geoLocation;
        this.description = description;
    }

    // Getter 和 Setter 方法
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getHotelName() {
        return hotelName;
    }

    public void setHotelName(String hotelName) {
        this.hotelName = hotelName;
    }

    public String getHotelBrand() {
        return hotelBrand;
    }

    public void setHotelBrand(String hotelBrand) {
        this.hotelBrand = hotelBrand;
    }

    public double getRating() {
        return rating;
    }

    public void setRating(double rating) {
        this.rating = rating;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getGeoLocation() {
        return geoLocation;
    }

    public void setGeoLocation(String geoLocation) {
        this.geoLocation = geoLocation;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

}
